using System;
using System.Collections;
using System.Collections.Generic;
using LL.Data.Mapping;


namespace NanoERP.Model
{
    /// <summary>
    /// 收付款账户信息
    /// </summary>
    [Serializable]
    public sealed class Accountinfo
    {
        #region Private Members

        // Variabili di stato
        private bool _isChanged;

        // Primary Key(s) 
        private long _id;

        // Properties 
        private string _accountname;
        private string _accountno;
        private string _accountpym;
        private long? _subjectid;
        private string _accounttypename;
        private string _currencyname;
        private DateTime? _begindate;
        private string _openingbank;
        private string _bankno;
        private string _accountowner;
        private long? _deptid;
        private int? _accountyear;
        private int? _accountmonth;
        private int? _accountyearlast;
        private int? _accountyearmonth;
        private DateTime? _lastcheckdate;
        private decimal? _beginmoney;
        private decimal? _begininmoney;
        private decimal? _beginoutmoney;
        private decimal? _endmoney;
        private int? _state;
        private int? _isdefault;
        private string _note;

        #endregion

        #region Default ( Empty ) Class Constructor

        /// <summary>
        /// default constructor
        /// </summary>
        public Accountinfo()
        {
            _id = 0;
            _accountname = null;
            _accountno = null;
            _accountpym = null;
            _subjectid = null;
            _accounttypename = null;
            _currencyname = null;
            _begindate = null;
            _openingbank = null;
            _bankno = null;
            _accountowner = null;
            _deptid = null;
            _accountyear = null;
            _accountmonth = null;
            _accountyearlast = null;
            _accountyearmonth = null;
            _lastcheckdate = null;
            _beginmoney = null;
            _begininmoney = null;
            _beginoutmoney = null;
            _endmoney = null;
            _state = 1;
            _isdefault = 0;
            _note = null;
        }

        #endregion // End of Default ( Empty ) Class Constructor

        #region Full Constructor

        /// <summary>
        /// full constructor
        /// </summary>
        public Accountinfo(long id, string accountname, string accountno, string accountpym, long? subjectid, string accounttypename, string currencyname, DateTime? begindate, string openingbank, string bankno, string accountowner, long? deptid, int? accountyear, int? accountmonth, int? accountyearlast, int? accountyearmonth, DateTime? lastcheckdate, decimal? beginmoney, decimal? begininmoney, decimal? beginoutmoney, decimal? endmoney, int? state, int? isdefault, string note)
        {
            _id = id;
            _accountname = accountname;
            _accountno = accountno;
            _accountpym = accountpym;
            _subjectid = subjectid;
            _accounttypename = accounttypename;
            _currencyname = currencyname;
            _begindate = begindate;
            _openingbank = openingbank;
            _bankno = bankno;
            _accountowner = accountowner;
            _deptid = deptid;
            _accountyear = accountyear;
            _accountmonth = accountmonth;
            _accountyearlast = accountyearlast;
            _accountyearmonth = accountyearmonth;
            _lastcheckdate = lastcheckdate;
            _beginmoney = beginmoney;
            _begininmoney = begininmoney;
            _beginoutmoney = beginoutmoney;
            _endmoney = endmoney;
            _state = state;
            _isdefault = isdefault;
            _note = note;
        }

        #endregion // End Full Constructor

        #region Public Properties

        /// <summary>
        /// 主键
        /// </summary>		
        public long Id
        {
            get { return _id; }
            set { _isChanged |= (_id != value); _id = value; }
        }

        /// <summary>
        /// 帐户名称
        /// </summary>		
        public string Accountname
        {
            get { return _accountname; }
            set
            {
                if (value != null)
                    if (value.Length > 200)
                        throw new ArgumentOutOfRangeException("Invalid value for Accountname", value, value.ToString());

                _isChanged |= (_accountname != value); _accountname = value;
            }
        }

        /// <summary>
        /// 帐户编号
        /// </summary>		
        public string Accountno
        {
            get { return _accountno; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Accountno", value, value.ToString());

                _isChanged |= (_accountno != value); _accountno = value;
            }
        }

        /// <summary>
        /// 拼音助记码
        /// </summary>		
        public string Accountpym
        {
            get { return _accountpym; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Accountpym", value, value.ToString());

                _isChanged |= (_accountpym != value); _accountpym = value;
            }
        }

        /// <summary>
        /// 对应会计科目编号(subject_no) ACCOUNTSUBJECT
        /// </summary>		
        public long? Subjectid
        {
            get { return _subjectid; }
            set { _isChanged |= (_subjectid != value); _subjectid = value; }
        }

        /// <summary>
        /// 会计科目名称
        /// </summary>
        [IgnoreAttribute()]
        public string SubjectName { get; set; }

        /// <summary>
        /// 会计科目编号
        /// </summary>
        [IgnoreAttribute()]
        public string SubjectNo { get; set; }

        /// <summary>
        /// 账户类别
        /// </summary>		
        public string Accounttypename
        {
            get { return _accounttypename; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Accounttypename", value, value.ToString());

                _isChanged |= (_accounttypename != value); _accounttypename = value;
            }
        }

        /// <summary>
        /// 币别
        /// </summary>		
        public string Currencyname
        {
            get { return _currencyname; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Currencyname", value, value.ToString());

                _isChanged |= (_currencyname != value); _currencyname = value;
            }
        }

        /// <summary>
        /// 开始日期
        /// </summary>		
        public DateTime? Begindate
        {
            get { return _begindate; }
            set { _isChanged |= (_begindate != value); _begindate = value; }
        }

        /// <summary>
        /// 开户银行
        /// </summary>		
        public string Openingbank
        {
            get { return _openingbank; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for Openingbank", value, value.ToString());

                _isChanged |= (_openingbank != value); _openingbank = value;
            }
        }

        /// <summary>
        /// 帐户
        /// </summary>		
        public string Bankno
        {
            get { return _bankno; }
            set
            {
                if (value != null)
                    if (value.Length > 50)
                        throw new ArgumentOutOfRangeException("Invalid value for Bankno", value, value.ToString());

                _isChanged |= (_bankno != value); _bankno = value;
            }
        }

        /// <summary>
        /// 开户名
        /// </summary>		
        public string Accountowner
        {
            get { return _accountowner; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for Accountowner", value, value.ToString());

                _isChanged |= (_accountowner != value); _accountowner = value;
            }
        }

        /// <summary>
        /// 部门编号 DEPTINFO
        /// </summary>		
        public long? Deptid
        {
            get { return _deptid; }
            set { _isChanged |= (_deptid != value); _deptid = value; }
        }

        /// <summary>
        /// 帐户开户年份
        /// </summary>		
        public int? Accountyear
        {
            get { return _accountyear; }
            set { _isChanged |= (_accountyear != value); _accountyear = value; }
        }

        /// <summary>
        /// 帐户开户月份
        /// </summary>		
        public int? Accountmonth
        {
            get { return _accountmonth; }
            set { _isChanged |= (_accountmonth != value); _accountmonth = value; }
        }

        /// <summary>
        /// 最后年份
        /// </summary>		
        public int? Accountyearlast
        {
            get { return _accountyearlast; }
            set { _isChanged |= (_accountyearlast != value); _accountyearlast = value; }
        }

        /// <summary>
        /// 
        /// </summary>		
        public int? Accountyearmonth
        {
            get { return _accountyearmonth; }
            set { _isChanged |= (_accountyearmonth != value); _accountyearmonth = value; }
        }

        /// <summary>
        /// 
        /// </summary>		
        public DateTime? Lastcheckdate
        {
            get { return _lastcheckdate; }
            set { _isChanged |= (_lastcheckdate != value); _lastcheckdate = value; }
        }

        /// <summary>
        /// 起始金额
        /// </summary>		
        public decimal? Beginmoney
        {
            get { return _beginmoney; }
            set { _isChanged |= (_beginmoney != value); _beginmoney = value; }
        }

        /// <summary>
        /// 收入金额
        /// </summary>		
        public decimal? Begininmoney
        {
            get { return _begininmoney; }
            set { _isChanged |= (_begininmoney != value); _begininmoney = value; }
        }

        /// <summary>
        /// 支出金额
        /// </summary>		
        public decimal? Beginoutmoney
        {
            get { return _beginoutmoney; }
            set { _isChanged |= (_beginoutmoney != value); _beginoutmoney = value; }
        }

        /// <summary>
        /// 余额
        /// </summary>		
        public decimal? Endmoney
        {
            get { return _endmoney; }
            set { _isChanged |= (_endmoney != value); _endmoney = value; }
        }

        /// <summary>
        /// 启用状态 0停用 1启用
        /// </summary>		
        public int? State
        {
            get { return _state; }
            set { _isChanged |= (_state != value); _state = value; }
        }

        /// <summary>
        /// 是否默认帐户 1是默认帐户 0不是默认帐户
        /// </summary>		
        public int? Isdefault
        {
            get { return _isdefault; }
            set { _isChanged |= (_isdefault != value); _isdefault = value; }
        }

        /// <summary>
        /// 备注
        /// </summary>		
        public string Note
        {
            get { return _note; }
            set
            {
                if (value != null)
                    if (value.Length > 300)
                        throw new ArgumentOutOfRangeException("Invalid value for Note", value, value.ToString());

                _isChanged |= (_note != value); _note = value;
            }
        }

        #endregion

    }
}